import store from "@/store";
import dayjs from "dayjs";
export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    type: "daterange",
    field: "shelfTime",
    label: "入库日期",
    otherOptions: {
      type: "datetimerange",
      rangeSeparator: "到",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      valueFormat: "yyyy-MM-dd HH:mm:ss",
    },
  },
  {
    type: "input",
    field: "userId",
    label: "会员id",
  },
  {
    type: "input",
    field: "inventoryEmployee",
    label: "入库员工",
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "入库员工",
    prop: "inventoryScanner",
  },
  {
    label: "小件数量",
    prop: "smallQuantity",
    width: 200,
  },
  {
    label: "大件数量",
    prop: "largeQuantity",
    width: 140,
  },
  {
    label: "重量",
    prop: "weight",
    width: 140,
  },
  {
    label: "计费重量",
    prop: "chargeWeight",
    width: 140,
  },
];
// 表格配置项
export const tableBase2 = [
  {
    label: "入库员工",
    prop: "inventoryScanner",
    width: 200,
  },
  {
    label: "单号",
    prop: "courierNumber",
    width: 140,
  },
  {
    label: "快递公司",
    prop: "companyName",
    width: 140,
  },
  {
    label: "入库时间",
    prop: "arrivalTime",
    width: 200,
  },
  {
    label: "库位",
    prop: "locationName",
    width: 140,
  },
  {
    label: "商品名称",
    prop: "cargoName",
    width: 140,
  },
  {
    label: "体积重",
    prop: "volumeWeight",
    width: 140,
  },
  {
    label: "重量",
    prop: "weight",
    width: 200,
  },
  {
    label: "会员昵称",
    prop: "userName",
    width: 200,
  },
  {
    label: "上架时间",
    prop: "shelfTime",
    width: 200,
  },
];
